<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="../common/tags.jsp"%>
<%@include file="../common/head.jsp"%>
<head>
	<title>清华 精品团课</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="keywords" content="todo,plan,task,backlog"/>
	<!--<link href="style/css/transdmin.css" rel="stylesheet" type="text/css" media="screen" /> -->
	<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie6.css" /><![endif]-->
	<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="style/css/ie7.css" /><![endif]-->
		<script type="text/javascript">
		function confirmUrl(url,msg) {
			if(confirm(msg)) {
				document.location.href=url;
			}
		}
	</script>
</head>
  <body>
<div class="menu">
<%@include file="../common/menu.jsp"%>
</div>


   <h3>活动管理</h3>
   <a href="publishInfo.do?m=addCampaign">添加活动</a>
  <br>
    <table border="1" align="left">
    <tr>
      <td width="4%">序号</td>      
      <td>活动名称</td>
	  <td>活动描述</td>
	  <td>折扣信息</td>
	  <td>是否发布过</td>
	  <td>发布时间</td>
	  <td>当前状态</td>
	  <td>操作</td>
    </tr>
   <c:forEach var="each" items="${allCampaign}" varStatus="s">
	<tr>
	  <td>${s.index}&nbsp;</td>
	  <td>${each.name}&nbsp;</td>	  
	  <td>${each.description}&nbsp;</td>
	  <td>${each.discountComments}&nbsp;</td>
	  <td>${each.isPublished}&nbsp;</td>
	  <td>${each.publishedTime}&nbsp;</td>
	  <td>${each.status}&nbsp;</td>	 
	  <td> 
	  <c:if test="${!each.isPublished }">
	  <a href="publishInfo.do?m=editCampaign&campaignId=${each.id }">修改</a>&nbsp;&nbsp;
	  <a href="javascript:confirmUrl('publishInfo.do?m=delCampaign&campaignId=${each.id }','确认删除？')">删除</a>
	  <a href="javascript:confirmUrl('publishInfo.do?m=publisCampaign&campaignId=${each.id }','确认发布？')">发布</a>&nbsp;
	  </c:if>
	   <c:if test="${each.isPublished }">
	  		<a href="#">查看</a>&nbsp;
	  		<a href="javascript:confirmUrl('publishInfo.do?m=toggleCampaign&campaignId=${each.id }','确认 <c:if test="${each.status == 'enable' }">下线 </c:if> <c:if test="${each.status == 'disable' }">	上线 </c:if>？')">
	  		 <c:if test="${each.status == 'enable' }">
	  			下线
	  		 </c:if>
	  		 <c:if test="${each.status == 'disable' }">
	  			上线
	  		 </c:if>
	  		</a> &nbsp;
  		 </c:if>
	  
	  </td>
	</tr>
  </c:forEach>
  </table>
  
  </body>
</html>
